package com.example.api.controller;

import com.example.api.aspect.SystemControllerLog;
import com.example.api.model.entity.Role;
import com.example.api.model.enums.ActionTypeEnum;
import com.example.api.service.RoleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@Api(tags = "角色管理")
@RestController
@RequestMapping("/api/role")
public class RoleController {
    
    @Resource
    private RoleService roleService;

    @ApiOperation("查询角色列表")
    @GetMapping("/")
    @SystemControllerLog(description = "查询角色列表", actionType = ActionTypeEnum.QUERY)
    public List<Role> findAll() {
        return roleService.findAll();
    }

}